(function($) {
$(window).bind("load", function() {
start();
});
})(jQuery);
window.onresize = function(event) {
render();
};
function go1(t) {
window.location="https://examination.drmojri.com/"+t.replace("&page=", "/").replace("&id=", "/");
}
function render(){
$(".square").css("max-height",$(".square").css("width"));
$(".square").css("min-height",$(".square").css("width"));
$(".slider").css("overflow","hidden");
var center_verticals=$(".center_vertical");
console.log(center_verticals.length);
center_verticals.each(function(){
var parent=$(this).parent();
p_height=parent.css("height").replace("px","");
t_height=$(this).css("height").replace("px","");
p_padding=parent.css("padding-top").replace("px","");
t_padding=$(this).css("padding-top").replace("px","");
var margin_top=(((p_height-t_height)/2)-p_padding)-t_padding;
$(this).css("margin-top",margin_top+"px");
});
}
function start(){
renew_captcha("login");
$(".loader").fadeOut();
$('input').keypress(function(e){
if(e.keyCode==13){
$(this).parent().parent().parent().find(".default").click();
}
});
var modal=
"
"+
"
"+
"
عنوان خطا
"+
""+
" "+
"
متن پیغام
"+
"
"+
"
"+
""+
"
"+
"
";
$('.sidenav').sidenav({edge:'right'});
$("body").append(modal);
$('.modal').modal();
$('select').formSelect();
$.each($(':checkbox'), function(k, v) {
var label = $(this).closest('label');
$(this).insertBefore(label);
});
$(".just_english").keypress(function(event){
var ew = event.which;
if(ew == 32)
return true;
if(48 <= ew && ew <= 57)
return true;
if(65 <= ew && ew <= 90)
return true;
if(97 <= ew && ew <= 122)
return true;
return false;
});
render();
}
function renew_captcha(id){
var img=$(".captcha_"+id);
img.fadeOut("slow",function(){
$.post("./core/post.php?cat=tools&action=captcha2",
{
id:id,
back:"8dc63f",
front:"362f2d"
},
function result(data, status){
img.attr("src",data);
img.fadeIn("slow");
render();
}
);
});
}
function login(){
if($("#user_login").val()==""||$("#pass_login").val()==""){
msg("خطا","نام کاربری و کلمه عبور صحیح نیست");
}else{
msg("ورود","در حال بررسی اطلاعات","");
$.post("./core/post.php?cat=user&action=loginUser",
{
user:$("#user_login").val().toEnglishDigit(),
pass:$("#pass_login").val().toEnglishDigit(),
captcha:$("#captchatext_login").val().toEnglishDigit()
},
function result(data, status){
console.log("*"+data+"*");
if(data=='1'){
go1('main');
//close_msg();
}else if(data=='0'){
msg("خطا","نام کاربری و کلمه عبور صحیح نیست");
}else if(data=='-1'){
msg("خطا","حساب کاربری فعال نشده لیک فعالسازی به پست الکترونیک شما ارسال شده در صورت عدم دریافت لینک از دکمه ارسال مجدد استفاده کنید",
"
"+
""+
""+
"
");
}else if(data=='-2'){
renew_captcha("login");
$("#pass_login").val("");
msg("خطا","پاسخ سوال امنیتی صحیح نیست");
}else if(data=='2'){
msg("خطا","حساب کاربری شما غیر فعال شده برای فعال سازی با پشتیبانی تیم آزمون های آنلاین دکتر مجری تماس بگیرید با آرزوی موفقیت");
}else{
msg("",data);
}
}
);
}
}
function resend_verification_mail(){
wait();
$.post("./core/post.php?cat=user&action=resend_verification_mail",
{
user:$("#user_login").val(),
pass:$("#pass_login").val()
},
function result(data, status){
if(data=='1'){
go1('main');
//close_msg();
}else if(data=='-1'){
msg("خطا","حساب کاربری فعال نشده لیک فعالسازی به پست الکترونیک شما ارسال شده در صورت عدم دریافت لینک از دکمه ارسال مجدد استفاده کنید",
"